<?php
class Table extends View {
	private $data;
	
	public function __construct(Model $model) {
		parent::__construct($model);
	}
	
	public function setData($data) {
		$this->data = $data;
	}
	 
	public function displayView() {
		echo '<table border="1">';
		$rows = count($this->data,0);
		$cols = (count($this->data,1)/count($this->data,0))-1;
		for($i=0;$i<$rows;$i++) {
			echo '<tr>';
			for($j=0;$j<$cols;$j++) {
				echo '<td>';
				echo $this->data[$i][$j];
				echo '</td>';
			}
			echo '</tr>';		
		}
		echo '</table>';
	}
	 
}
?>